package eval.utilities.random;

import cern.jet.random.AbstractDistribution;

/**
 * It always returns the same value
 * 
 * @author Nicolo' M. Calcavecchia <calcavecchia@elet.polimi.it>
 * */
public class ConstantDistribution extends AbstractDistribution {

	private static final long serialVersionUID = 1L;
	private int average;

	/**
	 * @Constructor
	 * @param average
	 */
	public ConstantDistribution(int average) {
		this.average = average;
	}

	/* (non-Javadoc)
	 * @see cern.jet.random.AbstractDistribution#nextDouble()
	 */
	@Override
	public double nextDouble() {
		return average;
	}

	/* (non-Javadoc)
	 * @see cern.jet.random.AbstractDistribution#nextInt()
	 */
	@Override
	public int nextInt() {
		return average;
	}
}
